package com.acsior.hibernate.vo;

// default package

import java.util.ArrayList;
import java.util.List;

import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.Id;
import javax.persistence.OneToMany;
import javax.persistence.Table;

import com.acsior.dac.impl.hibernate.vo.GeneratorKey;
import com.acsior.dac.impl.hibernate.vo.HibernateVO;

/**
 * CdTaxGroup entity. @author MyEclipse Persistence Tools
 */
@Entity
@Table(name = "cdTaxGroups")
@GeneratorKey(tableName = "cdTaxGroups")
public class CdTaxGroupVO extends HibernateVO {
	/**
	 * serialVersionUID
	 */
	private static final long serialVersionUID = 6383028649104272284L;

	@OneToMany(cascade = CascadeType.ALL, fetch = FetchType.LAZY, mappedBy = "cdTaxGroup")
	private List<CdCRCodeVO> cdCRCodes;

	@Column(name = "name", nullable = false)
	private String name;

	@Column(name = "tax", nullable = false, precision = 18)
	private double tax;

	@Id
	@Column(name = "taxGroupID", unique = true, nullable = false)
	private Integer taxGroupId;

	// Constructors

	/** default constructor */
	public CdTaxGroupVO() {
		this.cdCRCodes = new ArrayList<CdCRCodeVO>();
	}

	
	/**
	 * @return стойността на cdCRCodes
	 */
	public List<CdCRCodeVO> getCdCRCodes() {
		return this.cdCRCodes;
	}

	
	/**
	 * @param cdCRCodes се залага в cdCRCodes
	 */
	public void setCdCRCodes(List<CdCRCodeVO> cdCRCodes) {
		this.cdCRCodes = cdCRCodes;
	}

	
	/**
	 * @return стойността на name
	 */
	public String getName() {
		return this.name;
	}

	
	/**
	 * @param name се залага в name
	 */
	public void setName(String name) {
		this.name = name;
	}

	
	/**
	 * @return стойността на tax
	 */
	public double getTax() {
		return this.tax;
	}

	
	/**
	 * @param tax се залага в tax
	 */
	public void setTax(double tax) {
		this.tax = tax;
	}

	
	/**
	 * @return стойността на taxGroupId
	 */
	public Integer getTaxGroupId() {
		return this.taxGroupId;
	}

	
	/**
	 * @param taxGroupId се залага в taxGroupId
	 */
	public void setTaxGroupId(Integer taxGroupId) {
		this.taxGroupId = taxGroupId;
	}


	/**
	 * @see com.acsior.dac.data.Data#getId()
	 */
	@Override
	public Object getId() {
		return getTaxGroupId();
	}


	/**
	 * @see com.acsior.dac.impl.hibernate.vo.HibernateVO#setId(java.lang.Object)
	 */
	@Override
	public void setId(Object id) {
		setTaxGroupId(Integer.class.cast(id));
	}
	
}